<template>
	<!-- loding组件 -->
	<div class="tanbox" :style="{height:isShowLoading?'100%':0}">
		<a-spin class="a-span-modal" v-if="isShowLoading" />
	</div>
</template>

<script>
export default {
	name: 'Loading',
	props: {
		isShowLoading: Boolean,
		isFlag: Boolean,
		requestingCount: Number
	},
	data () {
		return {
			//初始化数据
		}
	},
	created () {
		//加载页面生命周期函数
	},
	mounted () {
	},
	computed: {
		//计算属性
	},
	watch: {
		//侦听属性
		isFlag: {
			// 异常时关闭 给与正确的提示
			handler (val) {
				if (val) {
					this.$notification['error']({
						key: 'flag',
						message: '系统提示',
						description: '网络超时,请重试'
					})
				}
			}
		},
		requestingCount: {
			handler (val) {
				if (val <= 0) {
					this.isShowLoading = false
				} else {
					// this.isShowLoading=true
				}
			}
		},

	},
	methods: {
		//处理事件

	},
	components: {
		//挂载组件
	}
}
</script>

<style scoped lang="less">
.tanbox {
	z-index: 99999;
	width: 100%;
	position: fixed;
	top: 0;
	background: rgba(0, 0, 0, 0.3);
}
.a-span-modal {
	width: 100%;
	height: 100%;
}
/deep/.ant-spin-dot{
	margin-top: 25%;
}
</style>
